package com.yiji.fintech.musfinance.common.strategy.converter;

import com.yiji.fintech.musfinance.common.domain.DepositBackDomain;
import com.yiji.fintech.musfinance.common.domain.base.BaseDomain;
import com.yiji.fintech.musfinance.common.domain.channel.ChannelDomain;
import com.yiji.fintech.musfinance.common.strategy.base.AbstractContext2DomainStrategy;
import com.yiji.fintech.musfinance.common.strategy.context.TransactionContext;
import org.springframework.stereotype.Service;

/**
 * 路由渠道上线文转换DepositBackDomain
 * Created by ouwen@yiji.com} on 2017/9/22.
 */
@Service
public class Context2DomainDepositBackStrategy extends AbstractContext2DomainStrategy {
    @Override
    public void doExcute(ChannelDomain channelDomain, BaseDomain domain) {
        DepositBackDomain deductDomain = (DepositBackDomain) domain;
        TransactionContext context = channelDomain.getContext();
        deductDomain.setGatewayChannelApi(channelDomain.getInstChannelApis().get(0).getGatewayChannelApi());
        deductDomain.setPartnerId(channelDomain.getPartnerId());
    }
}
